#include "ShapeFactory.h"
class Triangle:public ShapeFactory {
public:
	float a, b, c;
	Triangle(int q,int w,int e):a(q),b(w),c(e){}
	float Circumstance()
	{
		return a + b + c;
	}
};

class Quadri :public ShapeFactory {
public:
	float a, b, c, d;
	Quadri(int q, int w, int e,int r) :a(q), b(w), c(e) ,d(r){}
	float Circumstance()
	{
		return a + b + c + d;
	}
};

class Circle :public ShapeFactory {
public:
	float Ra;
	Circle(int r) :Ra(r) {};
	float Circumstance()
	{
		return 6.28 * Ra;
	}
};

ShapeFactory* ShapeFactory::Create(float a, float b, float c)
{

	ShapeFactory* p = new Triangle(a, b, c);
	return p;
}

ShapeFactory* ShapeFactory::Create(float a, float b, float c, float d)
{
	ShapeFactory* p = new Quadri(a, b, c, d);
	return p;

}

ShapeFactory* ShapeFactory::Create(float a)
{
	ShapeFactory* p = new Circle(a);
	return p;

}